import request from "@/request/request";

// 获取角色列表
export function getRoleList(data) {
    return request({
        method: "post",
        url: "/manpower/role/list",
        data: data
    })
}

// 添加角色
export function addRole(data) {
    return request({
        method: "post",
        url: "/manpower/role/add",
        data: data
    })
}

// 更新角色
export function updateRole(data) {
    return request({
        method: "post",
        url: "/manpower/role/update",
        data: data
    })
}

// 删除角色
export function deleteRole(id) {
    return request({
        method: "post",
        url: "/manpower/role/delete",
        params: { id: id }
    })
}

// 根据ID获取角色
export function getRoleById(id) {
    return request({
        method: "post",
        url: "/manpower/role/getById",
        params: { id: id }
    })
}

// 获取所有角色
export function getAllRoles() {
    return request({
        method: "post",
        url: "/manpower/role/getAll"
    })
}

// 获取角色的菜单权限
export function getRoleMenus(roleId) {
    return request({
        method: "post",
        url: "/manpower/role/getRoleMenus",
        params: { roleId: roleId }
    })
}

// 设置角色的菜单权限
export function setRoleMenus(data) {
    return request({
        method: "post",
        url: "/manpower/role/setRoleMenus",
        data: data
    })
}

// 获取所有菜单
export function getAllMenus() {
    return request({
        method: "post",
        url: "/manpower/role/getAllMenus"
    })
} 